package com.baizhi.service.impl;

import com.baizhi.aspect.LogAnnotation;
import com.baizhi.entity.Admin;
import com.baizhi.mapper.AdminMapper;
import com.baizhi.service.IAdminService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author haiyu
 * @since 2021-09-06
 */
@Service
public class AdminServiceImpl extends ServiceImpl<AdminMapper, Admin> implements IAdminService {


    @Autowired
    private IAdminService ia;
    @Resource
    private AdminMapper ib;
    @Override
    public Admin selectOne(String username) {
        QueryWrapper<Admin> wrapper=new QueryWrapper<>();
        wrapper.eq("username",username);//第一个参数是表里面的字段名，不能写成实体类的属性名
        return baseMapper.selectOne(wrapper);
    }

    @Override
    @LogAnnotation
    public Admin select(String name) {
        Admin select = baseMapper.select(name);
        return select;
    }
}
